package com.hdugraduate;

import java.io.File;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ViewAndUpload extends ListActivity {
    /** Called when the activity is first created. */
	File dir = new File("sdcard/TN/Photos/.");

	private String[] data =dir.list();
	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		// Create an array of Strings, that will be put to our ListActivity
		this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, data));
	}
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		//setContentView(R.layout.vp);
		//mimageview = (ImageView)findViewById(R.id.PhotoView);
		String imageUrl="sdcard/TN/Photos/"+data[position];
		//Bitmap bit = BitmapFactory.decodeFile(imageUrl); 
		//mimageview.setImageBitmap(bit);
		Intent turnToViewinte = new Intent(ViewAndUpload.this,ImageViewOne.class);
		Bundle bundle = new Bundle();
		bundle.putString("imageUrl",imageUrl);
		turnToViewinte.putExtras(bundle);
		startActivity(turnToViewinte);
	} 
}